import request from '@/utils/request';

/**
 * 查询课程分类列表
 * @param query
 * @returns {*}
 */

export const listCategory = (query) => {
  return request({
    url: '/bykt/category/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询课程分类详细
 * @param id
 */
export const getCategory = (id) => {
  return request({
    url: '/bykt/category/' + id,
    method: 'get'
  });
};

/**
 * 新增课程分类
 * @param data
 */
export const addCategory = (data) => {
  return request({
    url: '/bykt/category',
    method: 'post',
    data: data
  });
};

/**
 * 修改课程分类
 * @param data
 */
export const updateCategory = (data) => {
  return request({
    url: '/bykt/category',
    method: 'put',
    data: data
  });
};

/**
 * 删除课程分类
 * @param id
 */
export const delCategory = (id) => {
  return request({
    url: '/bykt/category/' + id,
    method: 'delete'
  });
};
